<template>
	<view class="time-box">
		
		<view class="time-t">
			
			<view class="day-time" :class="id==index?'day-time1':''" @click="clickDay(index)" v-for="(item,index) in timeList">
				<text class="text-1">{{item.week_text}}</text>
				<text class="text-2">{{item.date}}</text>
			</view>
		</view>
		<view class="time-b">
			<view class="time-time" @click="getTime(item,id)" v-for="(item,index) in timeList[id].time" v-if="item.is_busy_time!=true&&item.is_service_time!=true">
				<text>{{item.start_time}}</text>
				<text class="text-3">空闲</text>
			</view>
			<view class="time-time" style="background-color: #999;" v-else >
				<text>{{item.start_time}}</text>
				<text class="text-4">忙时</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			/* id: {
				type: Number,
				default: 0
			}, */
			timeList: {
				/* type: Number, */
				default: 0
			},
			getTime: {
				type: Function,
				default:null
			}
			
		},
		data() {

			return {
				day:'aaa',
				id:0
				
			}
		},
		onLoad() {
		
		
			
			
		},
		onShow() {
		
			
		},
	
		methods: {
			clickDay(e){
				this.id=e
				console.log(this.timeList,'****');
				this.day=this.timeList[this.id].date
				console.log(this.day);
			}
			
		}
	}
</script>

<style lang="scss" >
	.time-box{
		width: 100%;
		height: 100%;
		/* background-color: #66ffcc; */
		.time-t{
			width: 100%;
			height: 100rpx;
			/* background-color:#66ccff; */
			display: flex;
			justify-content: space-between;
			align-items: center;
			.day-time{
				width: 30%;
				height: 100%;
				display: flex;
				align-items: center;
				flex-direction: column;
				justify-content: center;
				background-color: #fff;
				border-radius: 20rpx;
				.text-1{
					font-size: 26rpx;
				}
				.text-2{
					font-size: 24rpx;
					color: #999;
				}
				
			}
			.day-time1{
				/* color: red; */
				color: #fff;
				background-color: #C74BF1;
			}
			
		}
		.time-b{
			width: 100%;
			margin-top: 60rpx;
			min-height: 700rpx;
			/* background-color: red; */
			display: flex;
			justify-content: flex-start;
			/* align-items: center; */
			flex-wrap: wrap;
			.time-time{
				width: 23%;
				border-radius: 10rpx;
				height: 100rpx;
				margin-bottom: 20rpx;
				margin-right: 12rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
				background-color: #fff;
				.text-3{
					font-size: 24rpx;
					color: #8538FC;
				}
				.text-4{
					font-size: 24rpx;
					color: red;
				}
			}
		}
	}

</style>
